At present, network administrator generally configures data for a network device using a Command Line Interface (CLI) provided on the network device; the specific configuration method, as shown in FIG. 1, mainly includes the following steps:
Step 101: first entering a global configuration mode according to an input configuration command, wherein the global configuration mode can contain a plurality of configuration modes and each configuration mode further can contain a plurality of configuration modes, like a tree structure; the global configuration mode contains a plurality of subnodes and each subnode also can contain a plurality of subnodes, and so on. Each configuration mode corresponds to a specific module on the network device;
Step 102: if it is needed to configure data in a first configuration mode (a subnode of the global configuration mode), inputting a mode switch command in the global configuration mode, switching from the global configuration mode to the first configuration mode and configuring data in the first configuration mode;
Step 103: if it is further needed to configure data in a second configuration mode (a subnode of the first configuration mode), then inputting a mode switch command in the first configuration mode, exiting from the first configuration mode, switching to the second configuration mode and configuring data in the second configuration mode;
Step 104: if it is further needed to configure data in a third configuration mode (a subnode of the global configuration mode), then inputting an exit command in the second configuration mode, exiting from the second configuration mode and switching back to the first configuration mode;
Step 105: inputting an exit command in the first configuration mode, exiting from the first configuration mode and switching back to the global configuration mode;
Step 106: inputting a mode switch command in the global configuration mode, switching to the third configuration mode from the global configuration mode, and configuring data in the third configuration mode.
As shown in FIG. 2, a specific embodiment of the above network data configuration method is provided; supposing the content of data configuration needed to be completed is as follows: data configuration of a gei—1/1 (Gigabit Ethernet Interface) module, data configuration of a BGP4+ (Border Gateway Protocol) module, data configuration of an address-family module and data configuration of a Virtual Local Area Network (VLAN) module.
From Step 201 to Step 209, it can be seen that, after configuring data of one module, if it is expected to configure data of another mode, it is needed to return to the global configuration mode from the configuration mode corresponding to the current module level by level and then to switch to the configuration mode corresponding to a next module from the global configuration mode level by level; for example, when it is needed to switch to the VLAN configuration mode from the address-family configuration mode of a subnode of the BGP4+ configuration mode as shown in FIG. 2, it is needed to switch first to the BGP4+ configuration mode from the address-family configuration mode, and then to the global configuration mode from the BGP4+ configuration mode, and finally to the VLAN configuration mode from the global configuration mode; during this process, multiple mode switch operations are executed, thus, the configuration efficiency of network data would be impacted inevitably.